package com.sky.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface ReportMapper {

    @Select("select sum(amount) from orders where status = #{status} and  order_time between #{begin} and #{end}")
    Double sumByCondition(@Param("status") Integer status,
                          @Param("begin") LocalDateTime begin,
                          @Param("end") LocalDateTime end);
}
